<% title @moment.name %>
<%= render :partial => '/moments/info', locals: { data: @moment } %>
<% if Rails.configuration.secret_share_enabled && @moment.owned_by?(current_user) %>
  <button class="secret-share-button" onclick="$('#secret-share-area').toggleClass('display_none')">
    <%= t ('moments.secret_share.singular') %>
  </button>
  <div class="<%= @moment.shared? ? '' : 'display_none' %>" id="secret-share-area">
    <%= button_to t('moments.secret_share.create'), secret_shares_path(moment: @moment.id), {class: 'secret-share-button'} %>
    <% if @moment.shared? %>
      <%= button_to t('moments.secret_share.cancel'), secret_share_path(@moment.secret_share_identifier), {method: :delete, class: 'secret-share-button'} %>
    <% end %>
    <% if @moment.secret_share_identifier %>
      <input type=text value="<%= secret_share_url(@moment.secret_share_identifier) %>">
      <form class="secret-share-expire">
        <%= t('moments.secret_share.expires_at') %>:
        <input type="date" name="expire">
        <input type="submit" value="<%= t('common.actions.submit') %>">
      </form>
    <% end %>
    <!-- <%= secret_share_url(@moment.secret_share_identifier) if @moment.secret_share_identifier %> -->
  </div>
<% end %>

<% if !@moment.why.blank? %>
  <p>
    <div class="label"><%= label_tag t('moments.form.why') %></div>
    <%= raw(@moment.why) %>
  </p>
<% end %>

<% if !@moment.fix.blank? %>
  <p>
    <div class="label"><%= label_tag t('moments.form.fix') %></div>
    <%= raw(@moment.fix) %>
  </p>
<% end %>

<% if @moment.strategy.count > 0 %>
  <p>
    <div class="label"><%= label_tag t('moments.show.strategies') %></div>
    <% @moment.strategy.each do |item| %>
        <span class="notification_wrapper">
          <span class="tip_notifications_button link_style"><%= Strategy.where(id: item).first.name %></span><% if @moment.strategy.last != item %><%= ', ' %><% end %>
          <%= render :partial => '/notifications/preview', locals: { data: Strategy.where(id: item).first, edit: edit_strategy_path(item) } %>
        </span>
    <% end %>
  </p>
<% end %>

<%= render :partial => '/shared/viewers_indicator', locals: { data: @moment } %>

<% if @comment.present? %>
  <%= render :partial => '/shared/comments', locals: { data: @moment, comments: @comments, comment: @comment, no_hide_page: @no_hide_page, commentable_type: 'moment' } %>
<% end %>
